import app from './app';
import { APP_PORT } from './app/app.config'
import { connection } from './app/database/mysql';
import { getAdmin } from './admin/admin.service';

app.listen(APP_PORT, () => {
  console.log('🚀 服务已启动 !', APP_PORT);

  // 每一个小时发送一次请求
  setInterval(() => {
    getAdmin()
  }, 3600000);
})

connection.connect(error => {
  if (error) {
    console.log('👻 数据仓库连接失败');
    return;
  }
  
  console.log('😄 成功连接数据仓库');
});
